<div ng-include src="'tpl/public/header.html'"></div>
<div class="contents">
  <ol class="breadcrumb">
    <li><a href="#/index/panel">首页</a></li>
    <li class="active">产品推荐列表</li>
  </ol>
  <form class="form-inline search-box" role="form" ng-submit="search()" novalidate>
    <a class="btn btn-default" href="javascript:" ng-click="toAddRecommend()">添加</a>
    <div class="form-group">
      <select class="form-control" ng-model="config.advertPosition" ng-options="r.value as r.text for r in dictMap.productRecommendModel" placeholder="推荐类型"></select>
    </div>
    <button type="submit" class="btn btn-primary">查询</button>
  </form>
  <div>
  </div>
  <table class="table table-striped table-hover">
    <thead>
      <tr>
        <th ng-show="config.advertPosition != '14'" style="width:120px">图片</th>
        <th>类型</th>
        <th>标题</th>
        <th>地址</th>
        <th style="width:100px">状态</th>
        <th style="width:120px">操作</th>
      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="r in recommendList">
        <td ng-show="config.advertPosition != '14'"><img ng-src="{{staticHost}}{{r.picAddre}}" width="110" height="65" style="width:110px; height:65px;"></td>
        <td style="vertical-align: middle;">{{r.advertPosition | productRecommendPositionRender}}</td>
        <td style="vertical-align: middle;">{{r.advertTitle}}</td>
        <td style="vertical-align: middle;">{{r.linkAddre}}</td>
        <td style="vertical-align: middle;">
          <span ng-class="{'text-muted':r.status=='02','text-primary':r.status=='01'}">{{r.status | advertStatusRender}}</span>
        </td>
        <td style="vertical-align: middle;">
          <a class="btn btn-default" href="#/chooseRecommend/edit?id={{r.id}}">编辑</a>
          <a class="btn btn-default" ng-click="stop(r.id)" ng-if="r.status == '01'">下架</a>
          <a class="btn btn-default" ng-click="start(r.id)" ng-if="r.status == '02'">上架</a>
        </td>
      </tr>
    </tbody>
  </table>
  <div class="pager-box" ng-include src="'tpl/public/pager.html'" ng-show="products.length > 0"></div>
</div>
